<template>
    <div class="app-container">

        <div class="card-wrap flex-column justify-end card-padding">

            <div class="card-title-wrap">
                <span>基本信息</span>
                <span></span>
            </div>

            <el-descriptions title="">
                <el-descriptions-item label="客户类型">
                    <dict-tag
                        :options="dict.type.customer_type"
                        :value="form.customerTypeCode"/>
                </el-descriptions-item>
                <el-descriptions-item label="客户标签">
                    {{form.customerLabel|filterNull}}
<!--                    <dict-tag-->
<!--                        :options="dict.type.customer_label"-->
<!--                        :value="form.customerLabelCode"/>-->
                </el-descriptions-item>
                <el-descriptions-item label="客户属性">
                    <dict-tag
                        :options="dict.type.customer_property"
                        :value="form.customerPropertyCode"/>
                </el-descriptions-item>
                <el-descriptions-item label="客户等级">
                    <dict-tag
                        :options="dict.type.customer_level"
                        :value="form.customerLevelCode"/>
                </el-descriptions-item>
                <el-descriptions-item label="业务范围">
                    <dict-tag
                        :options="dict.type.business_scope"
                        :value="form.businessScopeCode"/>
                </el-descriptions-item>
                <el-descriptions-item label="客户名称">{{ form.customerName|filterNull }}</el-descriptions-item>
                <el-descriptions-item label="联系方式">{{ form.customerPhone|filterNull }}</el-descriptions-item>
                <el-descriptions-item label="紧急联系人">{{ form.contact|filterNull }}</el-descriptions-item>
                <el-descriptions-item label="紧急联系人联系方式">{{
                        form.contactPhone|filterNull
                    }}
                </el-descriptions-item>
                <el-descriptions-item label="线索来源">
                    {{form.cluesSource|filterNull}}
<!--                    <dict-tag-->
<!--                        :options="dict.type.clues_source"-->
<!--                        :value="form.cluesSourceCode"/>-->
                </el-descriptions-item>
                <el-descriptions-item label="线索状态">
                    {{form.cluesStatus|filterNull}}
<!--                    <dict-tag-->
<!--                        :options="dict.type.clues_status"-->
<!--                        :value="form.cluesStatusCode"/>-->
                </el-descriptions-item>
                <el-descriptions-item label="意向情况">
                    <dict-tag
                        :options="dict.type.clues_intention"
                        :value="form.cluesIntentionCode"/>
                </el-descriptions-item>
                <el-descriptions-item label="跟进人">{{ form.followerNames|filterNull }}</el-descriptions-item>

            </el-descriptions>

        </div>

        <div class="card-wrap flex justify-end card-padding">
            <el-button @click="cancel">返回</el-button>
            <!--      <el-button :loading="buttonLoading" type="primary" @click="submitForm">保存</el-button>-->
        </div>

    </div>
</template>

<script>


import {cluesDetail} from "@/api/memberManage/clueList";

export default {
    name: "clueDetail",
    dicts: ['clues_follower_type', 'customer_type', 'customer_label', 'clues_intention',
        'customer_property', 'customer_level', 'business_scope', 'clues_source', 'clues_status'],
    data() {
        return {
            buttonLoading: false,
            form: {}
        };
    },
    watch:{
        // '$route':{
        //     handler(val){
        //         console.log('this.$route', this.$route)
        //
        //         if(val && val.name==this.$options.name){
        //             if (this.$route.query && this.$route.query.cluesId && !this.$route.query.tabClick) {
        //                 this.getOldData(this.$route.query.cluesId)
        //             }
        //         }
        //     },
        //     immediate:true,
        //     deep:true
        // }
    },
    created() {
        if (this.$route.query && this.$route.query.cluesId) {
          this.getOldData(this.$route.query.cluesId)
        }
    },
    methods: {
        cancel() {
            this.$router.back();
            this.$store.dispatch('tagsView/delView', this.$route);
        },
        submitForm() {

        },
        getOldData(cluesId) {
            cluesDetail(cluesId).then(res => {
                this.form = res.data.clues
            })
        },
    }
};
</script>


<style lang="scss" scoped>


</style>
